<template>
  <div >  
       <section class="user-info">
      <div class="title">
        <p>教师组列表</p>
      </div>
     
     <el-table
          :data="TeacherGroupList"
          style="width: 100%">
          <el-table-column
            prop="name"
            label="教师组名"
            width="180">
          </el-table-column>
          <el-table-column
            prop="academyId"
            label="学院"
            width="180">
          </el-table-column>
          <el-table-column
            prop="peopleNumber"
            label="人数"
            width="180">
          </el-table-column>
          <el-table-column
            prop="intro"
            label="介绍">
          </el-table-column>
          <el-table-column
            fixed="right"
            label="操作"
            width="100">
            <template slot-scope="scope">
             
                <el-button  type="text" size="small" @click=setGroupId(scope.row.id)>查看</el-button>
         
            </template>
          </el-table-column>
        </el-table>
    </section>
  </div>

</template>
<script>

 import teacherGroup from "api/teacherGroup";

import Academy from "api/Academy";
import teacher from "api/teacher";
export default {
  name: "teacherGroupList",
  data(){
    return{
   TeacherGroupList:[],
      loginInfo:{}, 
      teacherGroupEditButton:false,
      dialogVisible:false,
      teacherGroupInfo:{},
      TeacherAddList:[],
      teacherNum:1,
      CurrTeacherId:'',
      teacherList:[],
      academyList:[],
    }
  },
  created() {
 this.loginInfo = this.$store.state.userinfo
     this.getTeacherGroupList()
  },
  methods: {
    setGroupId(id){
  
      this.$store.state.userinfo.teacherGroupId=id
    },
   getAcademy(){
      Academy.getAcademyList().then(res=>{
        this.academyList=res.data.data.acaList
      })
    },
    initTeacherList() {
      teacher.getListTeacher().then(response => {
        this.teacherList = response.data.data.teachers
      })
    },
    //
    // openAddTeacherGroup(){
    //   this.TeacherAddList.push(this.loginInfo.teacher)
    //   this.dialogVisible=!this.dialogVisible
    //
    // },
    // addTeacherGroup(){
    //   teacherGroup.add(this.teacherGroupInfo,this.TeacherAddList).then(res=>{
    //     this.$message({
    //       type: 'success',
    //       message: "新建教师组成功"
    //     })
    //     this.dialogVisible=false
    //     this.teacherGroupInfo={}
    //     this.TeacherAddList=[]
    //     this.teacherNum=1
    //     this.getTeacherGroupList()
    //   })
    // },
    // deleteTeacherG(node,data){
    //   this.$confirm('确认删除？')
    //     .then(_ => {
    //       teacherGroup.deleteTeacherGroup(data.id).then(res=>{
    //         this.$message({
    //           type: 'success',
    //           message: "删除成功"
    //         })
    //         this.getTeacherGroupList()
    //         this.currentlabel='',
    //           this.currentGroupId=''
    //       })
    //     })
    //     .catch(_ => {});
    // },
    // addTeacher(){
    //   let flag=0
    //   if(this.TeacherAddList){
    //     for(let i=0;i<this.TeacherAddList.length;i++) {
    //       if (this.TeacherAddList[i] == this.CurrTeacherId) {
    //         flag=1
    //         break
    //       }
    //     }
    //   }
    //   if(flag==0&&this.CurrTeacherId){
    //     this.TeacherAddList.push(this.CurrTeacherId)
    //     this.teacherNum++
    //   }
    //   flag=0
    // },
    // clearTeacher(){
    //   this.TeacherAddList=[]
    // },
    getTeacherGroupList(){
      teacherGroup.getListTeacherGroupByTeacherId(this.loginInfo.id).then(res=>{
        this.TeacherGroupList=res.data.data.list
      })
    },
  }
}
</script>

<style scoped>

</style>

</script>
<style lang="stylus" scoped>
  .company-help {
    background: #e4e5e6;
    .user-info {
      font-size: 14px;
      background: #fafafa;
      margin-bottom: 20px;
      .title {
        background: #f0f1f3;
        height: 36px;
        line-height: 36px;
        p {
          display inline-block;
          height: 16px;
          line-height 16px;
          margin: 0 6px 0px 12px;
          padding-left: 6px;
          border-left: solid 4px #057ab8;
          vertical-align middle;
        }
      }
      .info {
        padding: 10px 0 10px 30px;
        .logo {
          display inline-block;
          width: 60px;
          height: 60px;
          margin-top: 8px;
          img {
            width: 100%;
            height: 100%;
          }
        }
        .info-right {
          display: inline-block;
          padding-top: 8px;
          min-height: 76px;
          line-height: 22px;
          margin-left: 12px;
          vertical-align: top;
          .account {
            font-weight: bold;
          }
        }
      }
    }
    .introduction {
      font-size: 14px;
      background: #fafafa;
      margin-bottom: 38px;
      .title {
        background: #f0f1f3;
        height: 36px;
        line-height: 36px;
        p {
          display inline-block;
          height: 16px;
          line-height 16px;
          margin: 0 6px 0px 12px;
          padding-left: 6px;
          border-left: solid 4px #057ab8;
          vertical-align middle;
        }
      }
      .intro {
        padding: 10px 0 10px 30px;
        li {
          padding: 10px;
          .icon-search {
            display:inline-block;
            width: 52px;
            height: 52px;
            background-image: url('/views/comp/features.png');
            background-position: 0 0;
          }
          .intro-detail {
            display: inline-block;
            margin-left: 12px;
            line-height: 20px;
            font-size: 12px;
            vertical-align: top;
            .intro-title {
              color: #0079bd;
              cursor: pointer;
            }
          }
        }
      }
    }
  }
</style>
